package nimble.pay.trade.server.system.chain.trade;

import nimble.pay.trade.server.framework.AbstractTradeProcessChain;
import nimble.pay.trade.server.framework.TradeProcessor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

/**交易前置处理链
 * @author max woods
 * @date 2018/8/7
 */

@Component
public final class BeforeTradeProcessChain extends AbstractTradeProcessChain {

  private static final Logger logger= LoggerFactory.getLogger(BeforeTradeProcessChain.class);

  @Autowired
  public BeforeTradeProcessChain(BeanFactory beanFactory)
  {
    super(beanFactory);
  }

  @Override
  protected void initChain(List<TradeProcessor> tradeProcessors)
  {
    logger.info("=========初始化交易前置处理链=========");
    tradeProcessors.add(beanFactory.getBean(TradePreProcessMerchant.class));
  }
}